//
//  TMNetDataInterface.m
//  TaskManager
//
//  Created by vip on 16/5/19.
//  Copyright © 2016年 M&H. All rights reserved.
//

#import "TMNetDataInterface.h"
#import "TMNetManager.h"

@implementation TMNetDataInterface

/**
 *  登录
 *
 *  @param completed void
 */
//+ (void)login:(GNRLoginParam*)model forgot:(BOOL)forgot finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:forgot?@"Forgot_login":@"Login" withParam:model forDataModel:model completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// *  发送短信验证码
// *
// *  @param completed void
// */
//+ (void)sendVercode:(GNRSendVercodeParam*)model forgot:(BOOL)forgot finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:forgot?@"Forgot_ver":@"Vertification" withParam:model forDataModel:model completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// *  注册
// *
// *  @param completed void
// */
//+ (void)registe:(GNRRegisterParam*)model finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Register" withParam:model forDataModel:model completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}

/**
 *  个人信息
 *
 *  @param completed void
 */
+ (void)profileInfo:(GNRProfileInfoParam*)model update:(BOOL)update finish:(completetionBlock)completed{
    [[TMNetManager sharedTheSingletion]netForRequestName:update?@"Update_Info":@"Get_Info" withParam:model forDataModel:model completion:^(BOOL success, TMNetError *error) {
        completed(success,error);
    }];
}


/**
 上传头像

 @param imgPath 图片path
 @param model 个人信息model
 @param value 上传进度
 @param completed 结果回调
 */
//+ (void)uploadHead:(NSString*)imgPath param:(GNRProfileInfoParam *)model progress:(void (^)(double progress))value finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion] uploadHead:imgPath withParam:model forDataModel:model progress:^(CGFloat progress) {
//        value(progress);
//    } completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
////计时上传
//+ (void)timingUpload:(GNRTimingParam *)model param:(NSMutableDictionary *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion] postParam:param forDataModel:model completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}

/**
 获取 一段时间 内的积分
 */
+ (void)getDayMarks:(GNRGetMarksParam *)marksParam finish:(completetionBlock)completed{
    [[TMNetManager sharedTheSingletion]netForRequestName:@"Mark_get_days" withParam:marksParam forDataModel:marksParam completion:^(BOOL success, TMNetError *error) {
        completed(success,error);
    }];
}

/**
 获取当日/总 积分/时间 获取
 */
+ (void)getMarkInfo:(GNRMarkInfoParam *)markInfoParam finish:(completetionBlock)completed{
    [[TMNetManager sharedTheSingletion]netForRequestName:@"Mark_get_today" withParam:markInfoParam forDataModel:markInfoParam completion:^(BOOL success, TMNetError *error) {
        completed(success,error);
    }];
}

///**
// 获取商家列表
// */
//+ (void)getShopList:(GNRShopListParam *)shopListParam Finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion] netForRequestName:@"Shop_list_get" withParam:shopListParam forDataModel:shopListParam completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// 获取商品列表
// */
//+ (void)getGoodsList:(GNRGoodsListParam *)goodsListParam Finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion] netForRequestName:@"Goods_list_get" withParam:goodsListParam forDataModel:goodsListParam completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// 商品详情
// */
//+ (void)getGoodsDetail:(GNRGoodsDetailParam *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Goods_information_get" withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// 购买商品优惠券
// */
//+ (void)buyDiscount:(GNRBuyDiscountParam *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Discount_buy" withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
///**
// 我的优惠券列表
// */
//+ (void)discountList:(GNRDiscountListParam *)param type:(GNRDiscountListGetType)type finish:(completetionBlock)completed{
//    NSString * api = type==GNRDiscountListGetTypeDiscountList?@"Discount_list_get":@"Buy_list_get";
//    [[TMNetManager sharedTheSingletion]netForRequestName:api withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
////使用优惠券
//+ (void)useDiscount:(GNRUseDiscountParam *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Discount_use" withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
////签到
//+ (void)dailySignIn:(GNRDailySignInParam *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Daily_sign_in" withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
//
////版本检测
//+ (void)checkVersion:(GNRVersionCheckParam *)param finish:(completetionBlock)completed{
//    [[TMNetManager sharedTheSingletion]netForRequestName:@"Version_update" withParam:param forDataModel:param completion:^(BOOL success, TMNetError *error) {
//        completed(success,error);
//    }];
//}
@end
